package com.unknow.first.dapp.admin.account.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 * @description 针对表【t_address_account_info】的数据库操作Mapper
 * @createDate 2022-05-17 10:21:36
 * @Entity com.unknow.first.dapp.admin.account.mapper.AddressAccountInfo
 */
public interface AddressAccountInfoMapper extends BaseMapper<AddressAccountInfo> {

    public int updateAccountInfoByPayLogs(Map<String, Object> params);

    /**
     * 通过detail去更新accountInfo的信息，如果没有就会创建出来，通过触发器控制balance不能小于0
     *
     * @param accountDetail
     * @return
     */
    public int updateBalanceByAccountDetail(AddressAccountDetail accountDetail);

    public List<AddressAccountInfo> queryAccountInfoByAddress(Map<String, Object> params);

    /**
     * 更新账户状态
     *
     * @param id
     * @param status
     * @return
     */
    int updateStatusById(@Param("id") Long id, @Param("status") Integer status);
}




